export default () => {
    'ngInject';
    return {
        restrict: 'E',
        templateUrl: 'app/component/employee_list/employeeList.html',
        scope: { employees: '=' },
        replace: true,
        controller: ($scope, $window) => {
            $scope.activeIndex = -1;
            $scope.showContent = (index) => {
                if (index === $scope.activeIndex) {
                    $scope.activeIndex = -1;
                }
                else {
                    $scope.activeIndex = index;
                }

            };
            $scope.callEmployee = (index) => {
                $window.alert('Should call ' + $scope.employees[index].name + ' with ' + $scope.employees[index].phone);
            };
        }
    };
};
